<script setup>
import {toRefs} from "vue";

const props = defineProps({
  route: {type: Object, required: true},
  // 是否使用中括号包裹内容
  bracket: {type: Boolean},
})
const {route} = toRefs(props)
</script>

<template>
  <router-link :to="route">
    <el-link :underline="false">
      <span v-if="bracket">
        [&nbsp;<slot></slot>&nbsp;]
      </span>
      <slot v-else/>
    </el-link>
  </router-link>
</template>

<style scoped>

</style>